<?php
abstract class GaAPI_Objects_Common_Operation {

    protected $_operator;
    public $operand;
    public $type;

    public function  __construct() {
        GaAPI_Autoloader::instance()->load('GaAPI_Objects_Common_Operator');
        $this->_operator = new GaAPI_Objects_Common_Operator();
    }

    public function  __set($name,  $value) {
        if ($name == 'operator') {
            $this->_operator->set($value);
        }
        return $this->$name = $value;
    }


    public function &__get($name) {
        if ($name == 'operator') {
            return $this->_operator;
        }
    }

    public function  __toString() {
        $request_xml .= '<operations>';
            $request_xml .= '<operator>' . $this->operator . '</operator>';
            $request_xml .= $this->toStringOperand();
        $request_xml .= '</operations>';
        return $request_xml;
    }

    protected function toStringOperand() {
        return '<operand>' . $this->operand . '</operand>';
    }
}